package com.zr.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.dao.impl.Zlroleimpl;
import com.zr.service.mainserver;
import com.zr.service.impl.mainserverimpl;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class Role  extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setCharacterEncoding("utf8");
		
		//Zlroleimpl allr  = new Zlroleimpl();
		//获得所有角色信息，下拉列表用
		mainserver ms =new mainserverimpl();
		JSONArray js = new JSONArray();
		js = ms.allrole();
		PrintWriter pw = resp.getWriter();
		
		pw.write(js.toString());
	}

}
